Conditions | 2 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { QueryHandler } from '@nestjs/cqrs'; |
||
13 | |||
14 | public async execute(query: GetShippingCostsQuery): Promise<ShippingCostView[]> { |
||
15 | const shippingcostViews: ShippingCostView[] = []; |
||
16 | const shippingCosts = await this.shippingcostRepository.findShippingCosts(); |
||
17 | |||
18 | for (const shippingCost of shippingCosts) { |
||
19 | shippingcostViews.push( |
||
20 | new ShippingCostView( |
||
21 | shippingCost.getId(), |
||
22 | shippingCost.getWeight(), |
||
23 | shippingCost.getPriceFromCents(), |
||
24 | ) |
||
25 | ); |
||
26 | } |
||
27 | |||
28 | return shippingcostViews; |
||
29 | } |
||
31 |